{% extends "base.html" %}

{% block title %}Activate{% endblock %}

{% block javascript %}
<script type="text/javascript" src="{{ STATIC_PREFIX }}js/d/jquery-1.7.1.min.js" ></script>
{% endblock %}

{% block ad %}
{% endblock %}

{% block content %}
<div id="dWrapper">

  <h1>Check your activation key on your mobile</h1>
  <br />
  <br />
  
  <form>
    <table>
      <tr>
        <td> Key </td>
        <td><input id="keyValue" type="text" name="key" /> <input type="submit" value="Register &rarr;"> </td>
      </tr>
      <tr>
        <td></td>
        <td>
          <br />
          <a href="/accounts/login/"><strong>Log in</strong></a> or 
          <a href="/accounts/register/"><strong>Sign up?</strong></a>
        </td>
      </tr>
    </table>
  </form>
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
</div>
<script type="text/javascript">
$("form").submit(function(){
    var keyValue = $("#keyValue").val();
    if (keyValue == "") {
        return false;
    }
    
    var addr = "http://brisbanecoupon.com/accounts/activate/" + keyValue + "/";
    
    {% if mobile %}
    location.replace(addr);
    {% else %}
    window.location.replace(addr);
    {% endif %}

    return false;
});
</script>

{% endblock %}
